package com.dragon.object;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Object的clone方法测试案例演示
 *
 * @author dragon
 * @since 2019/11/15
 */
public class CloneTest {
    public static void main(String[] args)
            throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Object   o      = new Object();
        Class<?> aClass = o.getClass();
        Method   clone  = aClass.getDeclaredMethod("clone");

        clone.setAccessible(true);

        Object invoke = clone.invoke(o);

        System.out.println(invoke);
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
